size=0
ls *.[ch] > tmp.txt
while read line    
do  
    count=`wc $line -l`  
    echo $count
    size=$(($size+1))
done < tmp.txt

echo $size

